package com.atguigu.yygh.user.config;/*
 * @author: XueYouPeng
 * @time: 2023/6/13 19:37
 */

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${wx.open.app_id}")
    private String app_id;

    @Value("${wx.open.app_secret}")
    private String app_secret;

    @Value("${wx.open.redirect_url}")
    private String redirect_url;

    public static String APP_ID;
    public static String APP_SECRET;
    public static String REDIRECT_URL;



    //当前对象中的各个属性初始化完毕
    @Override
    public void afterPropertiesSet() throws Exception {
        this.APP_ID = this.app_id;
        this.APP_SECRET = this.app_secret;
        this.REDIRECT_URL = this.redirect_url;
    }
}
